package cn.jhc.bean;

import java.math.BigDecimal;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

@Entity
@Table(name="score")
public class Score {
	private Integer scoreid;
	private BigDecimal uscore;
	private BigDecimal endscore;
	private BigDecimal totalscore;
	private String levelscore;
	private String remark;
	
	
	private Student student;
	private Course course;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="SCOREID")
	public Integer getScoreid() {
		return scoreid;
	}
	public void setScoreid(Integer scoreid) {
		this.scoreid = scoreid;
	}
	
	@Column(name="USCORE",precision=10,scale=2)
	public BigDecimal getUscore() {
		return uscore;
	}
	
	public void setUscore(BigDecimal uscore) {
		this.uscore = uscore;
	}
	@Column(name="ENDSCORE",precision=10,scale=2)
	public BigDecimal getEndscore() {
		return endscore;
	}
	public void setEndscore(BigDecimal endscore) {
		this.endscore = endscore;
	}
	@Column(name="TOTALSCORE",precision=10,scale=2)
	public BigDecimal getTotalscore() {
		return totalscore;
	}
	public void setTotalscore(BigDecimal totalscore) {
		this.totalscore = totalscore;
	}
	@Column(name="LEVELSCORE",columnDefinition="varchar(255)")
	public String getLevelscore() {
		return levelscore;
	}
	public void setLevelscore(String levelscore) {
		this.levelscore = levelscore;
	}
	@Column(name="REMARK",columnDefinition="varchar(255)")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	@ManyToOne()
	@Cascade (org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumn(name="SID",nullable=false)
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	@ManyToOne()
	@Cascade (org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumn(name="COURSENO",nullable=false)
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	
	
}
